﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="DeptComboxTree.ascx.cs" Inherits="UserControl_DeptComboxTree" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<ext:ComboBox ID="ComboBox1" runat="server" Width="202" MaxHeight="300" Editable="false"
    Mode="Local" ForceSelection="false" AllowBlank="true">
    <Items>
        <ext:ListItem />
    </Items>
    <Template ID="temp1" runat="server"><Html>
        <div style="width:100%;height:100%" id="myTree">
        </div></Html>
    </Template>
    <Listeners>
        <Expand Handler="#{TreePanel1}.render('myTree');" />
    </Listeners>
</ext:ComboBox>
<ext:TreePanel ID="TreePanel1" runat="server" Height="300" Width="200" AutoScroll="true"
    AutoRender="false" Icon="Foldergo" RootVisible="false">
    <Loader>
        <ext:PageTreeLoader OnNodeLoad="NodeLoad" PreloadChildren="true">
        </ext:PageTreeLoader>
    </Loader>
    <Root>
        <ext:AsyncTreeNode NodeID="0" Text="请选择树节点" Icon="ArrowRight">
        </ext:AsyncTreeNode>
    </Root>
    <Listeners>
        <%--<Click Handler="if(node.isLeaf()){#{ComboBox2}.setValue(node.text);#{ComboBox2}.collapse();}" />--%>
        <Click Handler="#{ComboBox1}.setValue(node.text);#{ComboBox1}.collapse();" />
    </Listeners>
</ext:TreePanel>
